<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/tld/tags.tld" prefix="t" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style/main.css">
    <title>Admissions. Catalog specialties</title>
</head>
<body>
<table class="tableBody">
    <tr>
        <td colspan="3">
            <t:header/>
        </td>
    </tr>
    <tr style="vertical-align: top">
        <td class="foot">
            <t:menu roleUser="${sessionScope.userRole}"/></td>
        <td style="background: #2c6932; width: 2px"/>
        <td style="width: 900px">
            <form name="selectSpecialty" action="controller" method="post">
                <c:set var="number" value="1"/>
                <table class="tableView">
                    <tr class="tableHeaderRow">
                        <td>№</td>
                        <td>Code</td>
                        <td>Name</td>
                        <td>Delete</td>
                    </tr>
                    <c:forEach var="specialty" items="${requestScope.specialties}">
                        <tr>
                            <td>${number}</td>
                            <td>
                                <input type="text" value="${specialty.code}" name="changeCode">
                                <input type="hidden" name="idCode" value="${specialty.id}">
                            </td>
                            <td>
                                <input type="text" value="${specialty.name}" name="changeName" style="width: 300px">
                                <input type="hidden" name="idName" value="${specialty.id}">
                            </td>
                            <td><input type="checkbox" value="${specialty.id}" name="checkbox"/></td>
                        </tr>
                        <c:set var="number" value="${number+1}"/>
                    </c:forEach>
                    <tr>
                        <td>${number}</td>
                        <td><input type="text" name="newCode"></td>
                        <td colspan="2"><input type="text" name="newName" style="width: 300px"></td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: left">
                            <input type="hidden" name="action" value="saveSpecialty">
                            <input type="submit" value="Save" name="submit" class="commandButton">
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <t:footer/>
        </td>
    </tr>
</table>
</body>
</html>